; generated by Component: ARM Compiler 5.06 update 7 (build 960) Tool: ArmCC [4d365d]
; commandline ArmCC [--list --split_sections --debug -c --asm --interleave -o..\out\stm32f10x_dac.o --asm_dir=.\Lst\ --list_dir=.\Lst\ --depend=..\out\stm32f10x_dac.d --cpu=Cortex-M4.fp.sp --apcs=interwork -O0 --diag_suppress=9931 -I..\Libraries\inc -I..\CMSIS -I..\users -I..\Libraries\src -I..\Libraries\sys -I..\COMM -I..\MOD -I..\CAN -D__MICROLIB -D__UVISION_VERSION=536 -D_RTE_ -DSTM32F412Rx -D_RTE_ -DSTM32F10X_HD -DUSE_STDPERIPH_DRIVER --omf_browse=..\out\stm32f10x_dac.crf ..\Libraries\src\stm32f10x_dac.c]
                          THUMB

                          AREA ||i.DAC_Cmd||, CODE, READONLY, ALIGN=2

                  DAC_Cmd PROC
;;;172      */
;;;173    void DAC_Cmd(uint32_t DAC_Channel, FunctionalState NewState)
000000  b139              CBZ      r1,|L1.18|
;;;174    {
;;;175      /* Check the parameters */
;;;176      assert_param(IS_DAC_CHANNEL(DAC_Channel));
;;;177      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;178      if (NewState != DISABLE)
;;;179      {
;;;180        /* Enable the selected DAC channel */
;;;181        DAC->CR |= (DAC_CR_EN1 << DAC_Channel);
000002  4a08              LDR      r2,|L1.36|
000004  6812              LDR      r2,[r2,#0]
000006  2301              MOVS     r3,#1
000008  4083              LSLS     r3,r3,r0
00000a  431a              ORRS     r2,r2,r3
00000c  4b05              LDR      r3,|L1.36|
00000e  601a              STR      r2,[r3,#0]
000010  e006              B        |L1.32|
                  |L1.18|
;;;182      }
;;;183      else
;;;184      {
;;;185        /* Disable the selected DAC channel */
;;;186        DAC->CR &= ~(DAC_CR_EN1 << DAC_Channel);
000012  4a04              LDR      r2,|L1.36|
000014  6812              LDR      r2,[r2,#0]
000016  2301              MOVS     r3,#1
000018  4083              LSLS     r3,r3,r0
00001a  439a              BICS     r2,r2,r3
00001c  4b01              LDR      r3,|L1.36|
00001e  601a              STR      r2,[r3,#0]
                  |L1.32|
;;;187      }
;;;188    }
000020  4770              BX       lr
;;;189    #if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL)
                          ENDP

000022  0000              DCW      0x0000
                  |L1.36|
                          DCD      0x40007400

                          AREA ||i.DAC_DMACmd||, CODE, READONLY, ALIGN=2

                  DAC_DMACmd PROC
;;;232      */
;;;233    void DAC_DMACmd(uint32_t DAC_Channel, FunctionalState NewState)
000000  b141              CBZ      r1,|L2.20|
;;;234    {
;;;235      /* Check the parameters */
;;;236      assert_param(IS_DAC_CHANNEL(DAC_Channel));
;;;237      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;238      if (NewState != DISABLE)
;;;239      {
;;;240        /* Enable the selected DAC channel DMA request */
;;;241        DAC->CR |= (DAC_CR_DMAEN1 << DAC_Channel);
000002  4a09              LDR      r2,|L2.40|
000004  6812              LDR      r2,[r2,#0]
000006  f44f5380          MOV      r3,#0x1000
00000a  4083              LSLS     r3,r3,r0
00000c  431a              ORRS     r2,r2,r3
00000e  4b06              LDR      r3,|L2.40|
000010  601a              STR      r2,[r3,#0]
000012  e007              B        |L2.36|
                  |L2.20|
;;;242      }
;;;243      else
;;;244      {
;;;245        /* Disable the selected DAC channel DMA request */
;;;246        DAC->CR &= ~(DAC_CR_DMAEN1 << DAC_Channel);
000014  4a04              LDR      r2,|L2.40|
000016  6812              LDR      r2,[r2,#0]
000018  f44f5380          MOV      r3,#0x1000
00001c  4083              LSLS     r3,r3,r0
00001e  439a              BICS     r2,r2,r3
000020  4b01              LDR      r3,|L2.40|
000022  601a              STR      r2,[r3,#0]
                  |L2.36|
;;;247      }
;;;248    }
000024  4770              BX       lr
;;;249    
                          ENDP

000026  0000              DCW      0x0000
                  |L2.40|
                          DCD      0x40007400

                          AREA ||i.DAC_DeInit||, CODE, READONLY, ALIGN=1

                  DAC_DeInit PROC
;;;97       */
;;;98     void DAC_DeInit(void)
000000  b510              PUSH     {r4,lr}
;;;99     {
;;;100      /* Enable DAC reset state */
;;;101      RCC_APB1PeriphResetCmd(RCC_APB1Periph_DAC, ENABLE);
000002  2101              MOVS     r1,#1
000004  0748              LSLS     r0,r1,#29
000006  f7fffffe          BL       RCC_APB1PeriphResetCmd
;;;102      /* Release DAC from reset state */
;;;103      RCC_APB1PeriphResetCmd(RCC_APB1Periph_DAC, DISABLE);
00000a  2100              MOVS     r1,#0
00000c  f04f5000          MOV      r0,#0x20000000
000010  f7fffffe          BL       RCC_APB1PeriphResetCmd
;;;104    }
000014  bd10              POP      {r4,pc}
;;;105    
                          ENDP


                          AREA ||i.DAC_DualSoftwareTriggerCmd||, CODE, READONLY, ALIGN=2

                  DAC_DualSoftwareTriggerCmd PROC
;;;283      */
;;;284    void DAC_DualSoftwareTriggerCmd(FunctionalState NewState)
000000  b130              CBZ      r0,|L4.16|
;;;285    {
;;;286      /* Check the parameters */
;;;287      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;288      if (NewState != DISABLE)
;;;289      {
;;;290        /* Enable software trigger for both DAC channels */
;;;291        DAC->SWTRIGR |= DUAL_SWTRIG_SET ;
000002  4907              LDR      r1,|L4.32|
000004  6809              LDR      r1,[r1,#0]
000006  f0410103          ORR      r1,r1,#3
00000a  4a05              LDR      r2,|L4.32|
00000c  6011              STR      r1,[r2,#0]
00000e  e005              B        |L4.28|
                  |L4.16|
;;;292      }
;;;293      else
;;;294      {
;;;295        /* Disable software trigger for both DAC channels */
;;;296        DAC->SWTRIGR &= DUAL_SWTRIG_RESET;
000010  4903              LDR      r1,|L4.32|
000012  6809              LDR      r1,[r1,#0]
000014  f0210103          BIC      r1,r1,#3
000018  4a01              LDR      r2,|L4.32|
00001a  6011              STR      r1,[r2,#0]
                  |L4.28|
;;;297      }
;;;298    }
00001c  4770              BX       lr
;;;299    
                          ENDP

00001e  0000              DCW      0x0000
                  |L4.32|
                          DCD      0x40007404

                          AREA ||i.DAC_GetDataOutputValue||, CODE, READONLY, ALIGN=2

                  DAC_GetDataOutputValue PROC
;;;429      */
;;;430    uint16_t DAC_GetDataOutputValue(uint32_t DAC_Channel)
000000  b508              PUSH     {r3,lr}
;;;431    {
000002  4601              MOV      r1,r0
;;;432      __IO uint32_t tmp = 0;
000004  2000              MOVS     r0,#0
000006  9000              STR      r0,[sp,#0]
;;;433      
;;;434      /* Check the parameters */
;;;435      assert_param(IS_DAC_CHANNEL(DAC_Channel));
;;;436      
;;;437      tmp = (uint32_t) DAC_BASE ;
000008  4805              LDR      r0,|L5.32|
00000a  9000              STR      r0,[sp,#0]
;;;438      tmp += DOR_OFFSET + ((uint32_t)DAC_Channel >> 2);
00000c  202c              MOVS     r0,#0x2c
00000e  eb000091          ADD      r0,r0,r1,LSR #2
000012  9a00              LDR      r2,[sp,#0]
000014  4410              ADD      r0,r0,r2
000016  9000              STR      r0,[sp,#0]
;;;439      
;;;440      /* Returns the DAC channel data output register value */
;;;441      return (uint16_t) (*(__IO uint32_t*) tmp);
000018  9800              LDR      r0,[sp,#0]
00001a  6800              LDR      r0,[r0,#0]
00001c  b280              UXTH     r0,r0
;;;442    }
00001e  bd08              POP      {r3,pc}
;;;443    
                          ENDP

                  |L5.32|
                          DCD      0x40007400

                          AREA ||i.DAC_Init||, CODE, READONLY, ALIGN=2

                  DAC_Init PROC
;;;116      */
;;;117    void DAC_Init(uint32_t DAC_Channel, DAC_InitTypeDef* DAC_InitStruct)
000000  b530              PUSH     {r4,r5,lr}
;;;118    {
;;;119      uint32_t tmpreg1 = 0, tmpreg2 = 0;
000002  2200              MOVS     r2,#0
000004  2300              MOVS     r3,#0
;;;120      /* Check the DAC parameters */
;;;121      assert_param(IS_DAC_TRIGGER(DAC_InitStruct->DAC_Trigger));
;;;122      assert_param(IS_DAC_GENERATE_WAVE(DAC_InitStruct->DAC_WaveGeneration));
;;;123      assert_param(IS_DAC_LFSR_UNMASK_TRIANGLE_AMPLITUDE(DAC_InitStruct->DAC_LFSRUnmask_TriangleAmplitude));
;;;124      assert_param(IS_DAC_OUTPUT_BUFFER_STATE(DAC_InitStruct->DAC_OutputBuffer));
;;;125    /*---------------------------- DAC CR Configuration --------------------------*/
;;;126      /* Get the DAC CR value */
;;;127      tmpreg1 = DAC->CR;
000006  4c0a              LDR      r4,|L6.48|
000008  6822              LDR      r2,[r4,#0]
;;;128      /* Clear BOFFx, TENx, TSELx, WAVEx and MAMPx bits */
;;;129      tmpreg1 &= ~(CR_CLEAR_MASK << DAC_Channel);
00000a  f64074fe          MOV      r4,#0xffe
00000e  4084              LSLS     r4,r4,r0
000010  43a2              BICS     r2,r2,r4
;;;130      /* Configure for the selected DAC channel: buffer output, trigger, wave generation,
;;;131         mask/amplitude for wave generation */
;;;132      /* Set TSELx and TENx bits according to DAC_Trigger value */
;;;133      /* Set WAVEx bits according to DAC_WaveGeneration value */
;;;134      /* Set MAMPx bits according to DAC_LFSRUnmask_TriangleAmplitude value */ 
;;;135      /* Set BOFFx bit according to DAC_OutputBuffer value */   
;;;136      tmpreg2 = (DAC_InitStruct->DAC_Trigger | DAC_InitStruct->DAC_WaveGeneration |
000012  e9d14500          LDRD     r4,r5,[r1,#0]
000016  432c              ORRS     r4,r4,r5
000018  688d              LDR      r5,[r1,#8]
00001a  432c              ORRS     r4,r4,r5
00001c  68cd              LDR      r5,[r1,#0xc]
00001e  ea440305          ORR      r3,r4,r5
;;;137                 DAC_InitStruct->DAC_LFSRUnmask_TriangleAmplitude | DAC_InitStruct->DAC_OutputBuffer);
;;;138      /* Calculate CR register value depending on DAC_Channel */
;;;139      tmpreg1 |= tmpreg2 << DAC_Channel;
000022  fa03f400          LSL      r4,r3,r0
000026  4322              ORRS     r2,r2,r4
;;;140      /* Write to DAC CR */
;;;141      DAC->CR = tmpreg1;
000028  4c01              LDR      r4,|L6.48|
00002a  6022              STR      r2,[r4,#0]
;;;142    }
00002c  bd30              POP      {r4,r5,pc}
;;;143    
                          ENDP

00002e  0000              DCW      0x0000
                  |L6.48|
                          DCD      0x40007400

                          AREA ||i.DAC_SetChannel1Data||, CODE, READONLY, ALIGN=2

                  DAC_SetChannel1Data PROC
;;;341      */
;;;342    void DAC_SetChannel1Data(uint32_t DAC_Align, uint16_t Data)
000000  b508              PUSH     {r3,lr}
;;;343    {  
;;;344      __IO uint32_t tmp = 0;
000002  2200              MOVS     r2,#0
000004  9200              STR      r2,[sp,#0]
;;;345      
;;;346      /* Check the parameters */
;;;347      assert_param(IS_DAC_ALIGN(DAC_Align));
;;;348      assert_param(IS_DAC_DATA(Data));
;;;349      
;;;350      tmp = (uint32_t)DAC_BASE; 
000006  4a05              LDR      r2,|L7.28|
000008  9200              STR      r2,[sp,#0]
;;;351      tmp += DHR12R1_OFFSET + DAC_Align;
00000a  f1000208          ADD      r2,r0,#8
00000e  9b00              LDR      r3,[sp,#0]
000010  441a              ADD      r2,r2,r3
000012  9200              STR      r2,[sp,#0]
;;;352    
;;;353      /* Set the DAC channel1 selected data holding register */
;;;354      *(__IO uint32_t *) tmp = Data;
000014  9a00              LDR      r2,[sp,#0]
000016  6011              STR      r1,[r2,#0]
;;;355    }
000018  bd08              POP      {r3,pc}
;;;356    
                          ENDP

00001a  0000              DCW      0x0000
                  |L7.28|
                          DCD      0x40007400

                          AREA ||i.DAC_SetChannel2Data||, CODE, READONLY, ALIGN=2

                  DAC_SetChannel2Data PROC
;;;366      */
;;;367    void DAC_SetChannel2Data(uint32_t DAC_Align, uint16_t Data)
000000  b508              PUSH     {r3,lr}
;;;368    {
;;;369      __IO uint32_t tmp = 0;
000002  2200              MOVS     r2,#0
000004  9200              STR      r2,[sp,#0]
;;;370    
;;;371      /* Check the parameters */
;;;372      assert_param(IS_DAC_ALIGN(DAC_Align));
;;;373      assert_param(IS_DAC_DATA(Data));
;;;374      
;;;375      tmp = (uint32_t)DAC_BASE;
000006  4a05              LDR      r2,|L8.28|
000008  9200              STR      r2,[sp,#0]
;;;376      tmp += DHR12R2_OFFSET + DAC_Align;
00000a  f1000214          ADD      r2,r0,#0x14
00000e  9b00              LDR      r3,[sp,#0]
000010  441a              ADD      r2,r2,r3
000012  9200              STR      r2,[sp,#0]
;;;377    
;;;378      /* Set the DAC channel2 selected data holding register */
;;;379      *(__IO uint32_t *)tmp = Data;
000014  9a00              LDR      r2,[sp,#0]
000016  6011              STR      r1,[r2,#0]
;;;380    }
000018  bd08              POP      {r3,pc}
;;;381    
                          ENDP

00001a  0000              DCW      0x0000
                  |L8.28|
                          DCD      0x40007400

                          AREA ||i.DAC_SetDualChannelData||, CODE, READONLY, ALIGN=2

                  DAC_SetDualChannelData PROC
;;;395      */
;;;396    void DAC_SetDualChannelData(uint32_t DAC_Align, uint16_t Data2, uint16_t Data1)
000000  b530              PUSH     {r4,r5,lr}
;;;397    {
;;;398      uint32_t data = 0, tmp = 0;
000002  2400              MOVS     r4,#0
000004  2300              MOVS     r3,#0
;;;399      
;;;400      /* Check the parameters */
;;;401      assert_param(IS_DAC_ALIGN(DAC_Align));
;;;402      assert_param(IS_DAC_DATA(Data1));
;;;403      assert_param(IS_DAC_DATA(Data2));
;;;404      
;;;405      /* Calculate and set dual DAC data holding register value */
;;;406      if (DAC_Align == DAC_Align_8b_R)
000006  2808              CMP      r0,#8
000008  d102              BNE      |L9.16|
;;;407      {
;;;408        data = ((uint32_t)Data2 << 8) | Data1; 
00000a  ea422401          ORR      r4,r2,r1,LSL #8
00000e  e001              B        |L9.20|
                  |L9.16|
;;;409      }
;;;410      else
;;;411      {
;;;412        data = ((uint32_t)Data2 << 16) | Data1;
000010  ea424401          ORR      r4,r2,r1,LSL #16
                  |L9.20|
;;;413      }
;;;414      
;;;415      tmp = (uint32_t)DAC_BASE;
000014  4b02              LDR      r3,|L9.32|
;;;416      tmp += DHR12RD_OFFSET + DAC_Align;
000016  f1000520          ADD      r5,r0,#0x20
00001a  442b              ADD      r3,r3,r5
;;;417    
;;;418      /* Set the dual DAC selected data holding register */
;;;419      *(__IO uint32_t *)tmp = data;
00001c  601c              STR      r4,[r3,#0]
;;;420    }
00001e  bd30              POP      {r4,r5,pc}
;;;421    
                          ENDP

                  |L9.32|
                          DCD      0x40007400

                          AREA ||i.DAC_SoftwareTriggerCmd||, CODE, READONLY, ALIGN=2

                  DAC_SoftwareTriggerCmd PROC
;;;259      */
;;;260    void DAC_SoftwareTriggerCmd(uint32_t DAC_Channel, FunctionalState NewState)
000000  b510              PUSH     {r4,lr}
;;;261    {
;;;262      /* Check the parameters */
;;;263      assert_param(IS_DAC_CHANNEL(DAC_Channel));
;;;264      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;265      if (NewState != DISABLE)
000002  b141              CBZ      r1,|L10.22|
;;;266      {
;;;267        /* Enable software trigger for the selected DAC channel */
;;;268        DAC->SWTRIGR |= (uint32_t)DAC_SWTRIGR_SWTRIG1 << (DAC_Channel >> 4);
000004  4a08              LDR      r2,|L10.40|
000006  6812              LDR      r2,[r2,#0]
000008  0904              LSRS     r4,r0,#4
00000a  2301              MOVS     r3,#1
00000c  40a3              LSLS     r3,r3,r4
00000e  431a              ORRS     r2,r2,r3
000010  4b05              LDR      r3,|L10.40|
000012  601a              STR      r2,[r3,#0]
000014  e007              B        |L10.38|
                  |L10.22|
;;;269      }
;;;270      else
;;;271      {
;;;272        /* Disable software trigger for the selected DAC channel */
;;;273        DAC->SWTRIGR &= ~((uint32_t)DAC_SWTRIGR_SWTRIG1 << (DAC_Channel >> 4));
000016  4a04              LDR      r2,|L10.40|
000018  6812              LDR      r2,[r2,#0]
00001a  0904              LSRS     r4,r0,#4
00001c  2301              MOVS     r3,#1
00001e  40a3              LSLS     r3,r3,r4
000020  439a              BICS     r2,r2,r3
000022  4b01              LDR      r3,|L10.40|
000024  601a              STR      r2,[r3,#0]
                  |L10.38|
;;;274      }
;;;275    }
000026  bd10              POP      {r4,pc}
;;;276    
                          ENDP

                  |L10.40|
                          DCD      0x40007404

                          AREA ||i.DAC_StructInit||, CODE, READONLY, ALIGN=1

                  DAC_StructInit PROC
;;;149      */
;;;150    void DAC_StructInit(DAC_InitTypeDef* DAC_InitStruct)
000000  2100              MOVS     r1,#0
;;;151    {
;;;152    /*--------------- Reset DAC init structure parameters values -----------------*/
;;;153      /* Initialize the DAC_Trigger member */
;;;154      DAC_InitStruct->DAC_Trigger = DAC_Trigger_None;
000002  6001              STR      r1,[r0,#0]
;;;155      /* Initialize the DAC_WaveGeneration member */
;;;156      DAC_InitStruct->DAC_WaveGeneration = DAC_WaveGeneration_None;
000004  6041              STR      r1,[r0,#4]
;;;157      /* Initialize the DAC_LFSRUnmask_TriangleAmplitude member */
;;;158      DAC_InitStruct->DAC_LFSRUnmask_TriangleAmplitude = DAC_LFSRUnmask_Bit0;
000006  6081              STR      r1,[r0,#8]
;;;159      /* Initialize the DAC_OutputBuffer member */
;;;160      DAC_InitStruct->DAC_OutputBuffer = DAC_OutputBuffer_Enable;
000008  60c1              STR      r1,[r0,#0xc]
;;;161    }
00000a  4770              BX       lr
;;;162    
                          ENDP


                          AREA ||i.DAC_WaveGenerationCmd||, CODE, READONLY, ALIGN=2

                  DAC_WaveGenerationCmd PROC
;;;313      */
;;;314    void DAC_WaveGenerationCmd(uint32_t DAC_Channel, uint32_t DAC_Wave, FunctionalState NewState)
000000  b510              PUSH     {r4,lr}
;;;315    {
;;;316      /* Check the parameters */
;;;317      assert_param(IS_DAC_CHANNEL(DAC_Channel));
;;;318      assert_param(IS_DAC_WAVE(DAC_Wave)); 
;;;319      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;320      if (NewState != DISABLE)
000002  b13a              CBZ      r2,|L12.20|
;;;321      {
;;;322        /* Enable the selected wave generation for the selected DAC channel */
;;;323        DAC->CR |= DAC_Wave << DAC_Channel;
000004  4b07              LDR      r3,|L12.36|
000006  681b              LDR      r3,[r3,#0]
000008  fa01f400          LSL      r4,r1,r0
00000c  4323              ORRS     r3,r3,r4
00000e  4c05              LDR      r4,|L12.36|
000010  6023              STR      r3,[r4,#0]
000012  e006              B        |L12.34|
                  |L12.20|
;;;324      }
;;;325      else
;;;326      {
;;;327        /* Disable the selected wave generation for the selected DAC channel */
;;;328        DAC->CR &= ~(DAC_Wave << DAC_Channel);
000014  4b03              LDR      r3,|L12.36|
000016  681b              LDR      r3,[r3,#0]
000018  fa01f400          LSL      r4,r1,r0
00001c  43a3              BICS     r3,r3,r4
00001e  4c01              LDR      r4,|L12.36|
000020  6023              STR      r3,[r4,#0]
                  |L12.34|
;;;329      }
;;;330    }
000022  bd10              POP      {r4,pc}
;;;331    
                          ENDP

                  |L12.36|
                          DCD      0x40007400
